package com.stox.charting.ui.swing.model;

import java.util.Calendar;

import com.stox.resources.i18n.MessageSource;

public enum ChartSpan {

	DAY1(Calendar.DATE, 1, MessageSource.getMessage("1Day")),
	MONTH1(Calendar.MONTH, 1, MessageSource.getMessage("1Month")),
	MONTH2(Calendar.MONTH, 2, MessageSource.getMessage("2Months")),
	QUARTER1(Calendar.MONTH, 3, MessageSource.getMessage("1Quarter")),
	QUARTER2(Calendar.MONTH, 6, MessageSource.getMessage("2Quarters")),
	QUARTER3(Calendar.MONTH, 9, MessageSource.getMessage("3Quarters")),
	YEAR1(Calendar.YEAR, 1, MessageSource.getMessage("1Year")),
	YEAR2(Calendar.YEAR, 2, MessageSource.getMessage("2Years")),
	YEAR3(Calendar.YEAR, 3, MessageSource.getMessage("3Years")),
	MAX(-1, -1, MessageSource.getMessage("Maximum"));
	
	private final int unit;
	private final int multiple;
	private final String text;
	
	private ChartSpan(int unit, int multiple, String text) {
		this.unit = unit;
		this.multiple = multiple;
		this.text = text;
	}

	public String getText() {
		return text;
	}
	
	public int getUnit() {
		return unit;
	}

	public int getMultiple() {
		return multiple;
	}
	
	@Override
	public String toString() {
		return getText();
	}
	
}
